<?php

/**
 * System form base class.
 *
 * @method System getObject() Returns the current form's model object
 *
 * @package    rpgcom
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseSystemForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idSystem'    => new sfWidgetFormInputHidden(),
      'name'        => new sfWidgetFormInputText(),
      'description' => new sfWidgetFormTextarea(),
      'dtCreation'  => new sfWidgetFormDate(),
    ));

    $this->setValidators(array(
      'idSystem'    => new sfValidatorPropelChoice(array('model' => 'System', 'column' => 'idSystem', 'required' => false)),
      'name'        => new sfValidatorString(array('max_length' => 50)),
      'description' => new sfValidatorString(),
      'dtCreation'  => new sfValidatorDate(),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'System', 'column' => array('name')))
    );

    $this->widgetSchema->setNameFormat('system[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'System';
  }


}
